package memleak.test.com.testlist;

/**
 * Created by runrun on 2017/3/9.
 */

public final class TransformBeanTool {

    private static final String TAG = "TransformBeanTool";


    public final static VideoBean transforVideoBean(LiveChannel bean) {
        if (null == bean) {
            return null;
        }
        VideoBean videoBean = new VideoBean();
        videoBean.setChannelNum(bean.getcNo());
        //videoBean.setPlayUrl(bean.getC_play_url());
        videoBean.setChannelName(bean.getcName());
        videoBean.setVideoId(bean.getVideoId());
        videoBean.setTemplatedId(bean.getTemplate_id());
        videoBean.setInstanceId(bean.getInstance_id());
        videoBean.setLogoUrl(bean.getcLogoUrl());
        videoBean.setBackground(bean.getBackgroundUrl());
        videoBean.setChannelCategory(bean.getCategory());
        videoBean.setVideoType(bean.getAppType());
        if (null != bean.getCaps() && bean.getCaps().contains("TSTV")) {
            videoBean.setSupportTS(true);
        } else {
            videoBean.setSupportTS(false);
        }
        DvbBean dvbBean = bean.getDvbBean();
        videoBean.setVideoId(dvbBean.getOriginalNetworkId() + "." + dvbBean.getTransportStreamId() + "." + dvbBean.getServiceId());
        videoBean.setDvb(dvbBean);
        ProgramUnit presentProgram = bean.getPresentProgram();
        ProgramUnit followingProgram = bean.getFollowingProgram();
        videoBean.setPresentProgram(presentProgram);
        videoBean.setFollowingProgram(followingProgram);
        return videoBean;
    }
}
